package com.reliable.service.serviceimpl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.reliable.common.annotation.DataSource;
import com.reliable.common.enums.DataSourceType;
import com.reliable.service.domain.AiAnalysisPrompt;
import com.reliable.service.mapper.AiAnalysisPromptMapper;
import com.reliable.service.service.IAiAnalysisPromptService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

@Service
public class AiAnalysisPromptServiceImpl
    extends ServiceImpl<AiAnalysisPromptMapper, AiAnalysisPrompt>
    implements IAiAnalysisPromptService {



    @Override
    @DataSource(value = DataSourceType.MASTER)
    public AiAnalysisPrompt getDefaultEnabledPrompt() {
        LambdaQueryWrapper<AiAnalysisPrompt> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(AiAnalysisPrompt::getDelFlag, 0)
                .eq(AiAnalysisPrompt::getStatus, 1)
                .eq(AiAnalysisPrompt::getIsDefault, 1);
        return baseMapper.selectOne(wrapper);
    }


}